;中断功能测试
;21h 输入输出字符串
sseg segment para stack
    dw 256 dup(?)
sseg ends

data segment
    tipstring db 'please input something buff<-',0dh,0ah,'$'
    outputstring db 'output buff->',0dh,0ah,'$'
    buffer db 80,?,80 dup('')
data ends

code segment
    assume cs:code,ds:data
start:
    ;dx out string address
    mov ax,data
    mov ds,ax
    ;tip
    mov dx,offset tipstring
    mov ah,9
    int 21h
    
    ;input string
    lea dx, buffer
    mov ah, 0ah
    int 21h
    
    ;out string
    lea dx, outputstring
    mov ah,9
    int 21h

    ;out buffer
    xor bx, bx
    mov bl, buffer[1]
    mov buffer[bx+2], '$'
    mov dx, offset buffer + 2
    mov ah,9
    int 21h
code ends
end start